package stark.app.function.view;

import android.view.View;

import com.chad.library.adapter.base.BaseQuickAdapter;

import androidx.annotation.NonNull;
import androidx.fragment.app.Fragment;
import stark.app.MainBaseFragment;
import stark.app.frame.TextItemBean;
import stark.app.function.view.photomodelview.PhotoModelViewFragment;
import stark.common.basic.view.PhotoModelView;

public class CustomViewItemFragment extends MainBaseFragment {


    @Override
    public void addDefaultData() {
        mAdapter.addData(new TextItemBean(PhotoModelView.class.getSimpleName(), PhotoModelViewFragment.class));
        mAdapter.addData(new TextItemBean("容器圆角示例", StkContainerFragment.class));
        mAdapter.addData(new TextItemBean("幸运转盘", StkTurnTableFragment.class));
        mAdapter.addData(new TextItemBean("9宫格幸运转盘", Stk9TurnTableFragment.class));
    }

    @Override
    public void onItemClick(@NonNull BaseQuickAdapter<?, ?> adapter, @NonNull View view, int position) {
        Class<?> clazz = mAdapter.getItem(position).getDestCls();
        if (clazz != null) {
            ShowViewFragmentActivity.start(getActivity(), (Class<? extends Fragment>) clazz);
        }
    }

}